Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 'zk.link' and some example linking commands #97

Merged
merged 5 commits into from
Feb 6, 2023

Conversation

psanker
Copy link
Contributor

@psanker psanker commented Jan 26, 2023

Adding support for zk-org/zk#284

"zk.link" performs the file linking operation that insertLinkAtLocation does in "zk.new" but without creating a new note. This allows users to create new linking capabilities, such as using match to find related notes and creating a link from the found note.

This PR also adds two commands:

  • ZkInsertLink
  • ZkInsertLinkAtSelection

Both use the note picker of choice to query all notes to find the desired note to create a link (solves #95)

"zk.link" performs the file linking operation that
`insertLinkAtLocation` does in "zk.new" but without creating a new note.
This allows users to create new linking capabilities, such as using
match to find related notes and creating a link from the found note.
Has both normal mode and visual mode behavior
Due to limitations of the neovim API
Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a super useful addition, thanks again! The matchSelected option is a nice touch as well. 👍

@@ -51,22 +51,45 @@ function M.get_lsp_location_from_selection()
}
end

---Fix to correct cursor location
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nvim cursor is (1,0)-indexed, so lines start at 1. Might be what's causing the issue you noticed.

@mickael-menu mickael-menu merged commit 0413c52 into zk-org:main Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants